extends ../layout

block content
  include ./parts/fileupload
  .container
    //- .modal.fade(id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true")
    //-   .modal-dialog.modal-lg
    //-     .modal-content#modal-content
    //-       .modal-header
    //-         button.close(type="button" data-dismiss="modal")
    //-           span(aria-hidden="true") &times;
    //-           span.sr-only Close
    //-         h4.modal-title(id="myModalLabel")
    //-       .modal-body
    //-         .modalbody#modalbody
    //-           .form-group
    //-             input.form-control(type='text', placeholder='create table', ng-model='formData.text')
    //-           .form-group
    //-             input.hidden(ng-model='formData.user', ng-init='formData.user=username="#{user.name}"')
    //-       .modal-footer
    //-         button.btn.btn-primary(type='submit', ng-click='createTodo()') Add
    .modal(style='position: relative;top: auto;right: auto;left: auto;bottom: auto;z-index: 1;display: block; overflow: visible; max-width: 1000px; margin: 0 auto;')
      .modal-dialog(style='position:static; margin: 10px 20px; width:auto;')
        .modal-content
          .modal-header
            h4.modal-title
              | 内容管理
          .modal-body
            table.table.table-bordered.table-hover.foo(data-show-toggle="false")
              thead
                tr
                  div.form-group.pull-right(style="width:40%")
                    div.input-group
                      input.form-control#searchText(type='text', placeholder="name, role, description or anything...", value="")
                      div.input-group-btn
                        button.btn.btn-default#searchDongle(type="button") Search
                tr.footable-header
                  th 序号
                  th 邮箱
                  th 上传时间
                  th 上传者
                  th 文件信息
                  th 文件大小
                  th 文件MD5
                  th 操作
              tbody
                tr(ng-repeat='todo in todos')
                  td {{ $index+1 }}
                  td
                  td
                  td {{ todo.user }}
                  td
                  td {{ todo.text }}
                  td
                  td
                    if user.role>=100
                      button.btn.btn-xs.btn-danger(type='button', ng-click='deleteTodo(todo._id)') 删除
                    else
                      button.btn.btn-xs.btn-danger(type='button', ng-click='pop("error","","无权删除")') 删除
          .modal-footer
            span 共有{{ todos.length }}条信息
            button(type="button" class="btn btn-primary" data-toggle="modal" data-target="#fileupload") 上传文件

script.
  jQuery(function($){
    $('table.foo').footable();
  });
